def pstring(o):
  str = ""
  for attr, value in o.__dict__.iteritems():
    if value:
      str += "%s:%s," %(attr, value) 
  return "{__%s__%s}" % (o.__class__.__name__, str[:-1])

def sm_res(responses):
  strings = []
  for res in responses:
    to = str(res.items()[0][0])
    type = res.items()[0][1]['type']
    data = res.items()[0][1]['data']
    try:
      msg = data.summary()
    except Exception:
      msg = ""
    string = "to: %s, type: %s msg: %s" %(to, type, msg)
    strings.append(string)
  return strings